# -*- coding: utf-8 -*-
"""
    url使用说明:

    GET方式都有_format属性
    _method只用在POST方式中

    第一个url匹配用GET或POST区分:
        (GET:返回列表): /his2/api/basic/argumentname/?_format=html
        (POST:添加数据): /his2/api/basic/argumentname/?field1=value1&field2=value2

    第二个url匹配用GET或POST区分:
        POST:
            (_method=delete:删除): /his2/api/basic/argumentname/1/?_method=delete
            (_method=put:修改): /his2/api/basic/argumentname/1/?_method=put&field=value
        GET:
            (GET:返回对象)/his2/api/basic/argumentname/1/
"""
from django.conf.urls.defaults import *
import views


urlpatterns = patterns('',
    (r'^(?P<app>\w+)/(?P<model>\w+)/$', views.get_list_or_create),
    (r'^(?P<app>\w+)/(?P<model>\w+)/new/$', views.new),
    (r'^(?P<app>\w+)/(?P<model>\w+)/(?P<id>\d+)/$', views.rud),
    (r'^(?P<app>\w+)/(?P<model>\w+)/(?P<id>\d+)/edit/$', views.edit),
)
